-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compare consts using ptr equality #72675
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit ef5aa6a with merge 7c7aeef41db36aadc9d940c74e5f21cdb9905c34... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-azure |
src/librustc_middle/ty/sty.rs
Outdated
@@ -2178,21 +2180,38 @@ impl<'tcx> TyS<'tcx> { | |||
} | |||
|
|||
/// Typed constant value. | |||
#[derive(Copy, Clone, Debug, Hash, RustcEncodable, RustcDecodable, Eq, PartialEq, Ord, PartialOrd)] | |||
#[derive(Debug, Hash, RustcEncodable, RustcDecodable, Eq, Ord, PartialOrd)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hash can hash the address now.
remove redundant `mk_const` Taken from rust-lang#72675 as this is fairly unrelated and that PR is more difficult than I imagined, so it may take some time until it lands.
I am currently getting the following errors:
Even after looking at #48923 I am still kind of stuck with what to do here. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Will close this PR for now as I don't know how to fix the current issues and we do not often compare |
Similar to
Ty<'tcx>
this PR now comparesConst
s using pointer equality.To prevent ourselves from accidentally creating a const on the stack I added a new
zero sized field to
Const
. This field has to bepublic
, to allow pattern matching on constsand has a private field, to prevent construction outside of
rustc_middle::ty
.Let's see if this actually changes perf in any meaningful way 🤷
I did not yet update the test output.